package io.scnb.lesson001.demo26.test5;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Service2 {
    
    // @Autowired标注在字段上，且字段对应的类型有多个候选值时，按照字段的名称在容器中进行查找，然后注入
    @Autowired
    private IService service1;

    @Override
    public String toString() {
        return "Service2{" +
                "service1=" + service1 +
                '}';
    }
}
